package net.akcegaraz.tipleague.client.event;

import net.akcegaraz.tipleague.shared.domain.Ticket;

import com.google.gwt.event.shared.GwtEvent;

public class TicketCreatedEvent extends GwtEvent<TicketCreatedEventHandler> {
    public static Type<TicketCreatedEventHandler> TYPE = new Type<TicketCreatedEventHandler>();
    private final Ticket ticket;

    public TicketCreatedEvent(Ticket ticket) {
	this.ticket = ticket;
    }

    @Override
    public Type<TicketCreatedEventHandler> getAssociatedType() {
	return TYPE;
    }

    /**
     * @return the ticket
     */
    public Ticket getCreatedTicket() {
	return ticket;
    }

    @Override
    protected void dispatch(TicketCreatedEventHandler handler) {
	handler.onTicketCreated(this);
    }
}
